package com.systop.workview.service;

import com.systop.common.util.ResponseResult;
import com.systop.workview.service.impl.StuHystric;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "student",fallback = StuHystric.class)//feign声明名字是supervise的项目
public interface StudentClientService {
        //RequestMapping的value是在 feign声明下的接口
        //login
        @PostMapping(value = "/studentLogin")
        ResponseResult studentLogin(@RequestParam(value = "sno") String sno, @RequestParam(value = "password") String password);
        //查全部
        @PostMapping (value = "/studentSupList")
        ResponseResult studentSupList();
        //根据tno查询
        @PostMapping (value = "/studentSupList1")
        ResponseResult studentSupList1(@RequestParam(value = "sno") String sno);
        //添加
        @RequestMapping(value = "/studentAdd",method = RequestMethod.POST)
        ResponseResult studentAdd(@RequestParam(value="sno") String sno, @RequestParam (value="password") String password,
                                  @RequestParam(value="name") String name, @RequestParam (value="college_name") String college_name,
                                  @RequestParam(value="grade") String grade, @RequestParam (value="class_name") String class_name,
                                  @RequestParam(value="remark") String remark);

        //修改
        @RequestMapping(value = "/updataStudent",method = RequestMethod.POST)
        ResponseResult updataStudent(@RequestParam(value="sno") String sno, @RequestParam (value="password") String password,@RequestParam(value="name") String name, @RequestParam (value="college_name") String college_name,@RequestParam(value="grade") String grade, @RequestParam (value="class_name") String class_name,@RequestParam(value="remark") String remark);

        //删除
        @PostMapping (value = "/delStudent")
        ResponseResult delStudent(@RequestParam(value = "sno") String sno);

//------------------查看选课---------------------------
        //添加
        @PostMapping (value = "/sxadd")
        ResponseResult sxadd(@RequestParam(value = "sno")String sno, @RequestParam(value = "elective_course_id")String elective_course_id
                ,@RequestParam(value = "student_name")String student_name,@RequestParam(value = "remark")String remark);

        //删除
        @PostMapping (value = "/sxdel")
        ResponseResult sxdel(@RequestParam(value = "student_elective_id") String student_elective_id);

        //根据tno查询
        @PostMapping (value = "/sxlistid")
        ResponseResult sxlistid(@RequestParam(value = "sno") String sno);

        //根据elective_course_id排课id查询
        @PostMapping (value = "/studentSelective_course_id")
        ResponseResult studentSelective_course_id(@RequestParam(value = "elective_course_id") String elective_course_id);

}
